<script>

    var d = {
        "default": {
            events: {
                tap: function (params) {
                    // on node click...
                    if (source == null) {
                        //... either set the current path source. here we also add a class
                        // so you can see its selected.
                        source = params;
                        jsPlumb.addClass(source.el, "jtk-animate-source");
                    }
                    else {
                        // ...or trace a path from the current source to the clicked node.
                        var traced = renderer.tracePath({
                            source: source.node,
                            target: params.node,
                            overlay: ["Diamond", {
                                width: 15,
                                length: 15,
                                fillStyle: "#89bcde"
                            }],
                            options: {
                                speed: 250
                            }
                        });
                        // cleanup the source for the next one.
                        jsPlumb.removeClass(source.el, "jtk-animate-source");
                        source = null;

                        if (!traced) {
                            alert("No path found!");
                        }
                    }
                }
            }
        }
    }


</script>
